package com.qf.controller;

import com.qf.bean.Dept;
import com.qf.service.DeptService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class DeptController {
    @Resource
    private DeptService deptService;
    @RequestMapping("/getAllDepts")
    public String list(ModelMap modelMap){
    List<Dept> deptlist=deptService.findAll();
    modelMap.addAttribute("deptlist",deptlist);
    return "register";

    }

}
